<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
%>
<html>
<head>
    <meta charset="utf-8"/>
    <title>密码重置</title>
    <link rel="stylesheet" href="<%=path %>/web/static/css/common.css"/>
    <link rel="stylesheet" href="<%=path %>/web/static/css/reset.css"/>
    <link rel="stylesheet" href="<%=path %>/web/static/css/forget_passwd.css"/>
    <link rel="stylesheet" href="<%=path %>/web/static/layui/css/layui.css">
</head>
<body>
<header id="header" class="">
    <div class="common-width">

        <section class="clearfix">
            <h1 class="logo" title="等你回家">
                <a href="<%=path %>/index"></a>
            </h1>
            <span class="page-name"> | 找回密码</span>
        </section>


    </div>
</header>

<section class="main">
    <div class="common-width">

        <div class="main-inner">
            <div class="passwd-nav-box">
                <ol class="passwd-nav">
                    <li class="first ">
                        <span><i>1</i><em>身份验证</em></span>
                    </li>
                    <li class="middle done">
                        <span><i>2</i><em>重设登录密码</em></span>
                    </li>
                    <li class="last ">
                        <span><i>3</i><em>完成</em></span>
                    </li>
                </ol>
            </div>

            <form id="resetform" action="<%=path %>/web/userinfo/resetPassword" method="post">
                <div class="fill-data-box" id="passStep">
                    <div class="fill-data">
                        <div class="title txt-center">您正在为账号${requestScope.phone}设置密码</div>
                        <input type="hidden" name="phone" value="${requestScope.phoneNum}">
                        <div class="form-group w275">
                            <input type="password" id="user_pass1" name="userpass" class="form-text" required="required" placeholder="请输入8位以上的新密码"/>
                        </div>
                        <div class="form-group w275">
                            <input type="password" id="user_pass2" class="form-text" required="required" placeholder="请再次输入新密码"/>
                        </div>
                        <div>
                            <button type="submit" class="form-btn" id="confirm">确认</button>
                        </div>
                    </div>
                </div>
            </form>

        </div>

    </div>
</section>
<footer id="footer1">
    <div class="footer-first gray">
        <div class="company-info clearfix fs14 gray">
            <a href="about.html" target="_blank"  rel="nofollow">关于我们</a>
            <a href="help.html" target="_blank"  rel="nofollow">帮助中心</a>
            <a href="javascript:;" target="_blank"  rel="nofollow">法律声明</a>
            <a href="jobs.html" target="_blank"  rel="nofollow">人才招聘</a>
            <a href="contact.html" target="_blank"  rel="nofollow">联系我们</a>
            <a href="javascript:;" user-feedback ng-click="userFeedback=true" class="last" rel="nofollow">意见反馈</a>
            <a href="javascript:;" class="last" target="_blank" style="display:none">上海餐厅导航</a>
        </div>
    </div>
    <div class="footer-last">
        <a target="_blank" class="foot-logo-1 base-logo" href="<%=path %>/index"></a>
        <div class="tc fs14 light-gray mb10">
            ©2019 Qingdao wanma school - 鲁ICP备11019908号
        </div>
    </div>
</footer>
<script type="text/javascript" src="<%=path %>/web/index/js/jquery.min.js"></script>
<script type="text/javascript" src="<%=path %>/web/static/layui/layui.all.js" charset="UTF-8"></script>
</body>
</html>
<script>
    $(function(){
        var pass1 = false;
        var pass2 = false;

        $("#user_pass1").blur(password1);
        $("#user_pass2").blur(password2);

        function password1(){
            if($("#user_pass1").val().length < 8) {
                layer.msg("密码长度不能少于8位",{icon:2})
                pass1 = false;
            } else if(!/^(\w){8,20}$/.test($("#user_pass1").val())) {
                layer.msg("密码只能包含字母、数字或下划线",{icon:2})
                pass1 = false;
            }else{
                pass1 = true;
            }
        }

        function password2() {
            if($("#user_pass1").val()!=$("#user_pass2").val()){
                layer.msg("两次输入的密码不一致",{icon:2})
                pass2 = false;
            }else{
                pass2 = true;
            }
        }


        $("#resetform").submit(function(){
            password1();
            password2();
            if(pass1==true&&pass2==true){
                return true;
            }else{
                return false;
            }
        })
    })
</script>